package org.cfk.delaytasktutorial.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.cfk.delaytasktutorial.entity.LazyJob;

@Mapper
public interface LazyJobMapper extends BaseMapper<LazyJob> {
    @Update("UPDATE tb_lazy_job SET take_state = 1, take_time = NOW() " +
            "WHERE id = #{id} AND take_state = 0")
    int takeJob(Long id);
}